<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('my_login'))
{
	function my_login($t)
	{
		$CI = & get_instance();
		if($t=="admin"){
			$l=$CI->login_lib->check_admin_login();
			if($l=="0"){
				redirect("admin/login");
			}
		}else if($t=="shareholder"){
			$l=$CI->login_lib->check_shareholder_login();
			if($l=="0"){
				redirect("shareholder/login");
			}
		}else if($t=="distributor"){
			$l=$CI->login_lib->check_distributor_login();
			if($l=="0"){
				redirect("distributor/login");
			}
		}else if($t=="agent"){
			$l=$CI->login_lib->check_agent_login();
			if($l=="0"){
				redirect("agent/login");
			}
		}else if($t=="member"){
			$l=$CI->login_lib->check_member_login();
			if($l=="0"){
				redirect("member/login");
			}
		}
	}
}

